package com.abc.test01

import android.annotation.SuppressLint
import android.content.ComponentName
import android.os.Bundle
import android.util.Log
import androidx.fragment.app.FragmentActivity
import com.abc.test01.databinding.ActivityDongGangAppListBinding


class DongGangAppListActivity : FragmentActivity() {
    private val CHANNEL_ID = "your_channel_id"
    private val CHANNEL_NAME = "Your Channel Name"
    private val NOTIFICATION_ID = 1 // 自定义的通知ID



//    fun sendNotification(context: Context, title: String?, message: String?)

    private lateinit var binding: ActivityDongGangAppListBinding
    @SuppressLint("SuspiciousIndentation")
    @OptIn(ExperimentalStdlibApi::class)
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityDongGangAppListBinding.inflate(layoutInflater)
        setContentView(binding.root)


        binding.a01.setText(R.string.a01);



        binding.btnBack.setOnClickListener {
            intent.component= ComponentName("com.test.aiagent","com.canbot.u05.activity.donggang.MyService")

//            throw RuntimeException("123")
            this@DongGangAppListActivity.stopService(intent)
            finish();
//            sendNotification(this, "通知标题", "通知内容");
//            throw RuntimeException("123")
        }
        binding.next.setOnClickListener {
            val  id =  R.integer.num;
            Log.e("11","id: "+id.toHexString());
          val  str =  this@DongGangAppListActivity.resources.getInteger(id)
            Log.e("11",str.toString());

//            val intent = Intent()
//            intent.component= ComponentName("com.test.aiagent","com.canbot.u05.activity.donggang.MyService")
//            this@DongGangAppListActivity.startForegroundService(intent);
//            startActivityForResult<DongGangAppListActivity2>(requestCode=12){
//
//            }
        }


    }

}